{extend name="index@common/base"/} 
{block name="style"}
{/block} 
{block name="body"}
<div class="layui-body layui-tab-content index-body" id="cont">
	<div class="park-navigation">
		<div class="navigation-icon">
			<i class="fa {$breadCrumb[0]['icon']}"></i>
		</div>
		<div class="navigation-menu">
			<h2>{$breadCrumb[0]['title']}</h2>
			{if isset($breadCrumb[1])}
			<p>{$breadCrumb[0]['remark']}</p>
			{/if}
		</div>
	</div>
	<div class="park-content">
		<div class="content-title">
			<div class="title col-8">
				<h3>{$breadCrumb[1]['title']}</h3>
				<form class="layui-form" action="{:url('admin/workflow/search')}" onsubmit="return false;">
					<button class="search-btn" lay-submit lay-filter="search"><img src="__STATIC__/img/base/topsearch01.png"></button>
					<input class="search-input" name="keyword" type="text" placeholder="请输入流程名称" id="keyword"  autocomplete="off">
				</form>	
			</div>
			<div class="tool col-2">
				<button id="add"  data-url="{:url('admin/workflow/add')}"><i class="fa fa-plus"></i></button>
				<button id="reload"><i class="fa fa-refresh"></i></button>
			</div>
		</div>
		<div class="layui-content" lay-accordion id="workflow" data-url="{:url('admin/workflow/index')}">
                    
    	</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__JS__/admin/workflow.js"></script>

 <script id="tableTemplate" type="text/html">
	
        {{# for(var i = 0;i < d.length; i++){ }}
		<div class="maintab">
        <table class="workflow-table">
           	<thead>
			<tr>
                <th>流程名称</th>
                <th>流程类型</th>
				<th>步骤总数</th>
				<th>备注</th>
                <th style="text-align:center;">
					<a class="layui-btn btn-config add-step"  data-url="{:url('admin/workflow/addStep')}?workflowId={{d[i].id}}"><i class="fa fa-plus"></i></a>
					<a class="layui-btn btn-edit edit-workflow"  data-url="{:url('admin/workflow/edit')}?workflowId={{d[i].id}}"><i class="fa fa-pencil"></i></a>
  					<a class="layui-btn btn-de del-workflow" data-url="{:url('admin/workflow/del')}?workflowId={{d[i].id}}"><i class="fa fa-trash"></i></a>
				</th>
            </tr>
			</thead>
			<colgroup>
                 <col width="15%">
                 <col width="15%">
				 <col width="15%">
				 <col width="40%">
            </colgroup>
			<tbody>
  				<tr>
                 	<th class="collapse">{{d[i].flowName}}</th>
                 	<th class="collapse">{{d[i].wfType}}</th>
					<th class="collapse">{{d[i].stepTotal}}</th>
					<th colspan="2" class="collapse">{{d[i].remark}}</th>
            	</tr>
			</tbody>
        </table>
        {{# if(d[i].steps != null){ }}
            <div class="maintab">
                <table class="step-table detail-table">
                    <colgroup>
						<col width="5%">
                        <col width="15%">
                 		<col width="45%">
				 		<col width="20%">
                    </colgroup>
                    <tbody>
                        {{# for(var j = 0;j < d[i].steps.length; j++){ }}
                        <tr>
							<td style="text-align:center">
								<p>{{d[i].steps[j].orderIndex}}</p>
							</td>
                            <td>
                                <p><b>步骤: </b>{{d[i].steps[j].wfStepName}}</p>
                            </td>
                            <td>
                                <p><b>描述: </b>{{d[i].steps[j].wfStepDesc}}</p>
                            </td>
                            <td>
                               <p><b>负责人: </b>{{d[i].steps[j].charge.userName}}</p>
                            </td>
                            <td style="text-align:center;">
								<span><a class="layui-btn btn-edit edit-step" data-url="{:url('admin/workflow/editStep')}?stepId={{d[i].steps[j].id}}"><i class="fa fa-pencil"></i></a></span>
                                <span><a class="layui-btn btn-del del-step" data-url="{:url('admin/workflow/delStep')}?stepId={{d[i].steps[j].id}}"><i class="fa fa-trash"></i></a></span>
                            </td>
                        </tr>
                         {{# } }}
                    </tbody>
                </table>
            </div>
          {{# } }}
		</div>
      {{# } }}
    </script>
{/block}
